<script type="text/javascript" src="/siscel/js/paciente.js"></script>
<link rel="stylesheet" type="text/css" href="/siscel/css/upload.css" />
<div id="msg"></div>
<form name="testeEnvio" id="testeEnvio" action="cadastrar" method="POST">
    <fieldset>
        <table width="98%" border="0" cellspacing="0" cellpadding="2">
            <thead>
            <th colspan="3">
                <b>INFORMAÇÕES BÁSICAS</b>
            </th>
            <th style="text-align: right;">
                <img src="/siscel/img/bt_apagar.gif" id="" />
                <img src="/siscel/img/bt_lapis.gif" id="" />
            </th>
            </thead>
            <tr>
                <td colspan="2">
                    <?php echo $this->Form->input('Paciente.NM_PAC', array('type' => 'text', 'label' => 'Nome', 'id' => 'NM_PAC', 'class' => 'campoAlfa required', 'size' => "30", 'maxlength' => "120")); ?>
                </td>
                <td width="25%">
                    <?php echo $this->Form->input('Paciente.NUM_CPF_PAC', array('type' => 'text', 'label' => 'CPF', 'id' => 'NUM_CPF_PAC', 'class' => 'campoCPF required', 'size' => "20", 'maxlength' => "14", 'readonly' => $bloquear)); ?>
                </td>
                <td width="25%">
                    <?php echo $this->Form->input('Paciente.SEXO', array('type' => 'select', 'label' => 'Sexo', 'id' => 'SEXO', 'options' => array('' => 'Selecione um item', 'M' => 'Masculino', 'F' => 'Feminino', 'N' => 'Não Informado',))); ?>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <?php echo $this->Form->input('Paciente.NM_MAE', array('type' => 'text', 'label' => 'Nome da Mãe', 'id' => 'NM_MAE', 'class' => 'campoAlfa', 'size' => "30", 'maxlength' => "120")); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Paciente.RACA', array('type' => 'select', 'label' => 'Raça', 'id' => 'RACA', 'options' => $arrRaca)); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Paciente.CO_ETNIA', array('type' => 'select', 'label' => 'Etnia', 'id' => 'CO_ETNIA', 'options' => $arrEtnia)); ?>
                </td>            
            </tr>
            <tr>
                <td>
                    <?php echo $this->Form->input('Paciente.DT_NASC', array('type' => 'text', 'label' => 'Nascimento', 'id' => 'DT_NASC', 'class' => 'campoDATE', 'maxlength' => "14", 'readonly' => $bloquear)); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Paciente.CD_CID_NAT', array('type' => 'text', 'label' => 'Cidade Nascimento', 'id' => 'CD_CID_NAT', 'class' => 'campoDATE', 'maxlength' => "14", 'readonly' => $bloquear)); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Paciente.CD_UF', array('type' => 'select', 'label' => 'UF', 'id' => 'CD_UF', 'options' => $arrUf)); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Paciente.PAIS', array('type' => 'text', 'label' => 'País', 'id' => 'PAIS', 'options' => array('' => 'Selecione um item', '1' => 'Brasil'))); ?>
                </td>            
            </tr>
            <tr>
                <td colspan="2">
                    <?php echo $this->Form->input('Paciente.EMAIL', array('type' => 'email', 'label' => 'Email principal', 'id' => 'EMAIL', 'class' => 'campoEmail', 'size' => "30", 'maxlength' => "60")); ?>
                </td>
                <td colspan="2">
                    <?php echo $this->Form->input('Paciente.E_MAIL', array('type' => 'email', 'label' => 'Email secundario', 'id' => 'E_MAIL', 'class' => 'campoEmail', 'size' => "30", 'maxlength' => "60")); ?>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <?php echo $this->element('telefone/cadastroFone'); ?>
                </td>
                <td >
                    <div class="box100 centro" style="display: table-caption;">
                        <?php
                        $usuarioRequest = $this->request->data('Usuario');
                        if (!empty($usuarioRequest['IM_FOTO'])) :
                            echo $this->Siscel->foto($usuarioRequest['IM_FOTO']);
                        else:
                            echo $this->Html->image('/img/perfil.jpg', array('width' => '100', 'heigth' => '133', 'label' => null));
                        endif;
                        ?>
                    </div>
                    <div class="box100 centro" style="display: block;">
                        <?php echo $this->Form->input('Paciente.fotoUsuario', array('type' => 'file', 'size' => '0', 'style' => 'width: 100px;', 'label' => '')); ?>
                    </div>
                </td>
            </tr>
        </table>

        <legend>File upload</legend>
        <!-- o elemento a permite a utilização do seletor :hover em browsers antigo -->
        <!-- a href="#upload" class="input upload ">
            <button type="button">Incluir / Alterar Foto</button -->
            <?php echo $this->Form->input('InstituicaoLab.fotoUsuario', array('type' => 'file', 'size' => '0', 'style' => 'width: 100px;', 'label' => '', 'class' => '')); ?>
        <!-- /a -->
        <div class="buttons">
            <button type="reset" class="gray thin">Reset</button>
            <button type="submit" class="blue big">Upload</button>
        </div>

        <table width="98%" border="0" cellspacing="0" cellpadding="2">
            <thead>
            <th colspan="3">
                <b>INFORMAÇÕES HIV</b>
            </th>
            <th style="text-align: right;">
                <img src="/siscel/img/bt_lapis.gif" id="addHiv" title="Adicionar Informações HIV"/>
            </th>
            </thead>
            <tbody>
                <tr id="listSemHiv">
                    <td colspan="3">Sem registros</td>
                    <td></td>
                </tr>
            <tbody>
        </table>

        <table width="98%" border="0" cellspacing="0" cellpadding="2">        
            <thead>
            <th colspan="3">
                <b>INFORMAÇÕES COMPLEMENTARES</b>
            </th>
            <th style="text-align: right;">
                <img src="/siscel/img/bt_lapis.gif" id="addComplementar" />
            </th>
            </thead>
            <tbody>
                <tr>
                    <td colspan="3">Sem registros</td>
                    <td></td>
                </tr>
            <tbody>
        </table>

        <table width="98%" border="0" cellspacing="0" cellpadding="2">        
            <thead>
            <th colspan="3">
                <b>RESPONSÁVEL</b>
            </th>
            <th style="text-align: right;">
                <img src="/siscel/img/bt_lapis.gif" id="addResponsavel" />
            </th>
            </thead>
            <tbody>
                <tr>
                    <td colspan="3">Sem registros</td>
                    <td></td>
                </tr>
            <tbody>
        </table>

        <table width="98%" border="0" cellspacing="0" cellpadding="2">        
            <thead>
            <th colspan="3">
                <b>SITUAÇÃO</b>
            <th style="text-align: right;">
                <img src="/siscel/img/bt_lapis.gif" id="" />
            </th>
            </thead>
            <tbody>
                <tr>
                    <td colspan="3">Sem registros</td>
                    <td></td>
                </tr>
            <tbody>
        </table>
        <?php //  $this->Js->submit('Salvar', array('before' =>$this->Js->get('#aguardarAjax')->effect('fadeIn'), 'success'=>$this->Js->get('#aguardarAjax')->effect('fadeOut'),'update' => '#dialog-form','action' =>'cadastro'     )) ?>
    </fieldset>
    <div class="submit"><input type="submit" value="Enviar"></div>
</form>
<div id="dlgHIV" title="Informações HIV" style="display: none;">
    <div>
        <table>
            <tr>
                <td>
                    <?php echo $this->Form->input('dtaDiagnostico', array('type' => 'text', 'label' => 'Diagnóstico HIV', 'id' => 'dtaDiagnostico', 'class' => 'campoDATE', 'maxlength' => "14")); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <?php echo $this->Form->input('dtaAntiretroviral', array('type' => 'text', 'label' => '1.o Antiretroviral', 'id' => 'dtaAntiretroviral', 'class' => 'campoDATE', 'maxlength' => "14")); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <?php
                    $options = array('1' => 'Sim', '0' => 'Não');
                    $attributes = array('legend' => false);
                    echo $this->Form->radio('dtaCaso',$options,$attributes);
                    ?>
                </td>
            </tr>
        </table>
    </div>
</div>
<?php echo $this->element('pacientes/informacao-complementar'); ?>
<div id="dlgComplementar" title="Adicionar Informações Complementares" style="display: none;">
    <div>
        <table>
            <tr>
                <td>
                    <?php echo $this->Form->input('Paciente.CD_ESCOLARIDADE', array('type' => 'select', 'label' => 'Escolaridade', 'id' => 'CD_ESCOLARIDADE', 'options' => $arrEscolaridade)); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Paciente.CD_ESTADO_CIVIL', array('type' => 'select', 'label' => 'Estado Civil', 'id' => 'CD_ESTADO_CIVIL', 'options' => $arrEstadoCivil)); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Paciente.CD_GESTANTE', array('type' => 'select', 'label' => 'Gestante', 'id' => 'CD_GESTANTE', 'options' => array('' => 'Selecione um item', 'S' => 'Sim', 'N' => 'Não'))); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <?php echo $this->Form->input('Paciente.NM_PAI', array('type' => 'text', 'label' => 'Nome do Pai', 'id' => 'NM_PAI', 'maxlength' => "60", 'class' => 'alfanumeric')); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Paciente.NUM_RG', array('type' => 'text', 'label' => 'RG', 'id' => 'NUM_RG', 'maxlength' => "30", 'class' => 'alfanumeric')); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Paciente.ORGAO_EXPED', array('type' => 'text', 'label' => 'OE', 'id' => 'ORGAO_EXPED', 'maxlength' => "12", 'class' => 'alfanumeric')); ?>
                </td>
            </tr>
        </table>
    </div>
</div>
<div id="dlgRepresentante" title="Adicionar Responsável" style="display: none;">
    <div>
        <table>
            <tr>
                <td>
                    <?php echo $this->Form->input('nomeResponsavel', array('type' => 'text', 'label' => 'Responsável', 'id' => 'nomeResponsavel', 'maxlength' => "60")); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <?php echo $this->Form->input('cpfResponsavel', array('type' => 'text', 'label' => 'CPF', 'id' => 'cpfResponsavel', 'maxlength' => "14", 'class' => 'campoCPF')); ?>
                </td>
            </tr>
        </table>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        Paciente.init();
    });
</script>